/**
 * Created by lhy on 2017/7/8.
 */
var toastrComponent = function () {

    function initOption(){
        toastr.options = {
            "closeButton": true,
            "debug": false,
            "positionClass": "toast-top-center",
            "onclick": null,
            "showDuration": "1000",
            "hideDuration": "1000",
            "timeOut": "5000",
            "extendedTimeOut": "1000",
            "showEasing": "swing",
            "hideEasing": "linear",
            "showMethod": "fadeIn",
            "hideMethod": "fadeOut"
        }
    }

    function showToastr(cls,msg,title){
        toastr[cls](msg, title);
    }

    return {
        //main function to initiate the module
        init: function () {
            initOption();
        },
        show: function(cls,msg,title){
            showToastr(cls,msg,title);
        }
    };
}();

jQuery(document).ready(function($) {
    toastrComponent.init();
});